<template>
    <div>   
      <van-button  type="primary" @click="showPopup" >
          主要按钮</van-button>
          <van-popup   van-popup v-model="show">
              <van-datetime-picker
                v-model="currentDate"
                type="date"
                title="选择年月日"
                @confirm="confirm"
                :min-date="minDate"
                :max-date="maxDate"
                />
          </van-popup>
    </div>
</template>

<script>
// import Vue from 'vue';
import  vanButton  from 'vant/lib/button';
import vanPopup  from 'vant/lib/popup';
import  vanDatetimePicker from 'vant/lib/datetime-picker';
export default {
    data () {
        return { 
            show: false,
             minDate: new Date(2020, 0, 1),
             maxDate: new Date(2025, 10, 1),
             currentDate: new Date(2021, 0, 17),
        }
        
    },
    components: {
        vanButton,
        vanPopup,
        vanDatetimePicker,
    },
    methods:{
        showPopup() {
      this.show = true;
      },
      confirm (value) {
          console.log(value);
      }
    }
}
</script>

<style scoped>

</style>